package com.hns.can.report.service;

import java.util.List;
import java.util.Map;

import com.hns.can.report.entity.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.energy.vo.EaiIttriplogTabVo;
import com.hns.can.report.vo.QualityDetailParamVo;
import com.hns.frame.enumrate.MsgType;
import com.hns.frame.exception.BusinessException;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.tool.pub.PubUtil;

/**
 * 质量分析明细service
 * @author chenl
 * @email:370238764@qq.com
 * @version Revision 2.0.0
 */
@Service
public class QualityAnlsDetailService extends CommonService {

	 /**
     * 分页查询车辆行为明细日报
     *
     * @param map
     * @return
     * @throws Exception
     * @author:Chenl
     * @email:
     */
    @Transactional
    @LeftOrgAnnotation()
    public Pagination searchTBsStatDayBhvPage(QualityDetailParamVo qualityDetailParamVo) throws Exception {
        Pagination page = this.myBatisPage("qualityAnlsDetail.getTBsStatDayBhvCnt","qualityAnlsDetail.getTBsStatDayBhvList", qualityDetailParamVo, TBsStatDayBhvEntity.class);
        return page;
    }
    
    /**
     * 导出车辆行为明细日报PDF
     * @param qualiityDetailParamVo
     * @return
     */
    @Transactional
    @LeftOrgAnnotation()
    public List<TBsStatDayBhvEntity> searchTBsStatDayBhvList(QualityDetailParamVo qualiityDetailParamVo){
    	List<TBsStatDayBhvEntity> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("qualityAnlsDetail.getTBsStatDayBhvList",qualiityDetailParamVo), TBsStatDayBhvEntity.class);
    	if(PubUtil.isEmpty(list)){
    		throw new BusinessException(MsgType.WARN.getFlag(), "没有数据导出！");
    	}
    	return list;
    }

    /**
     * 分页查询车辆能耗统计日报
     *
     * @param map
     * @return
     * @throws Exception
     * @author:Chenl
     * @email:
     */
    @Transactional
    @LeftOrgAnnotation()
    public Pagination searchTBsStatDayEnerConsPage(QualityDetailParamVo qualityDetailParamVo) throws Exception {
        Pagination page = this.myBatisPage("qualityAnlsDetail.getTBsStatDayEnerConsCnt","qualityAnlsDetail.getTBsStatDayEnerConsList", qualityDetailParamVo, TBsStatDayEnerConsEntity.class);
        return page;
    }
    /**
     * 导出车辆能耗明细日报PDF
     * @param qualityDetailParamVo
     * @return
     */
    @Transactional
    @LeftOrgAnnotation()
    public List<TBsStatDayEnerConsEntity> searchTBsStatDayEnerConsList(QualityDetailParamVo qualityDetailParamVo){
    	List<TBsStatDayEnerConsEntity> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("qualityAnlsDetail.getTBsStatDayEnerConsList",qualityDetailParamVo), TBsStatDayEnerConsEntity.class);
    	if(PubUtil.isEmpty(list)){
    		throw new BusinessException(MsgType.WARN.getFlag(), "没有数据导出！");
    	}
    	return list;
    }

    /**
     * 分页查询车辆故障明细日报
     *
     * @param map
     * @return
     * @throws Exception
     * @author:Chenl
     * @email:
     */
    @Transactional
    @LeftOrgAnnotation()
    public Pagination searchTBsStatDayMftPage(QualityDetailParamVo qualityDetailParamVo) throws Exception {
        Pagination page = this.myBatisPage("qualityAnlsDetail.getTBsStatDayMftCnt","qualityAnlsDetail.getTBsStatDayMftList", qualityDetailParamVo, TBsStatDayMftEntity.class);
        return page;
    }
    /**
     * 导出车辆故障明细日报
     * @param qualityDetailParamVo
     * @return
     * @throws Exception
     */
    @Transactional
    @LeftOrgAnnotation()
    public List<TBsStatDayMftEntity> searchTBsStatDayMftList(QualityDetailParamVo qualityDetailParamVo) throws Exception {
    	List<TBsStatDayMftEntity> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("qualityAnlsDetail.getTBsStatDayMftList",qualityDetailParamVo), TBsStatDayMftEntity.class);
    	if(PubUtil.isEmpty(list)){
    		throw new BusinessException(MsgType.WARN.getFlag(), "没有数据导出！");
    	}
    	return list;
    }

    /**
     * 分页查询车辆里程明细日报
     *
     * @param map
     * @return
     * @throws Exception
     * @author:zhangzq
     * @email:
     */
    @Transactional
    @LeftOrgAnnotation()
    public Pagination searchTBsStatDayMilePage(QualityDetailParamVo qualityDetailParamVo) throws Exception {
        Pagination page = this.myBatisPage("qualityAnlsDetail.getTBsStatDayMileCnt","qualityAnlsDetail.getTBsStatDayMileList", qualityDetailParamVo, TBsStatDayMileEntity.class);
        return page;
    }
    /**
     * 导出车辆里程明细日报
     * @param qualityDetailParamVo
     * @return
     * @throws Exception
     */
    @Transactional
    @LeftOrgAnnotation()
    public List<TBsStatDayMileEntity> searchTBsStatDayMileList(QualityDetailParamVo qualityDetailParamVo) throws Exception {
    	List<TBsStatDayMileEntity> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("qualityAnlsDetail.getTBsStatDayMileList",qualityDetailParamVo), TBsStatDayMileEntity.class);
    	if(PubUtil.isEmpty(list)){
    		throw new BusinessException(MsgType.WARN.getFlag(), "没有数据导出！");
    	}
    	return list;
    }

    /**
     * 分页查询车辆在线率明细日报
     *
     * @param map
     * @return
     * @throws Exception
     * @author:Chenl
     * @email:
     */
    @Transactional
    @LeftOrgAnnotation()
    public Pagination searchTBsStatDayOnlinePage(QualityDetailParamVo qualityDetailParamVo) throws Exception {
        Pagination page = this.myBatisPage("qualityAnlsDetail.getTBsStatDayOnlineCnt","qualityAnlsDetail.getTBsStatDayOnlineList", qualityDetailParamVo, TBsStatDayOnlineEntity.class);
        return page;
    }
    /**
     * 导出车辆在线率明细日报
     * @param qualityDetailParamVo
     * @return
     * @throws Exception
     */
    @Transactional
    @LeftOrgAnnotation()
    public List<TBsStatDayOnlineEntity> searchTBsStatDayOnlineList(QualityDetailParamVo qualityDetailParamVo) throws Exception {
    	List<TBsStatDayOnlineEntity> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("qualityAnlsDetail.getTBsStatDayOnlineList",qualityDetailParamVo), TBsStatDayOnlineEntity.class);
    	if(PubUtil.isEmpty(list)){
    		throw new BusinessException(MsgType.WARN.getFlag(), "没有数据导出！");
    	}
    	return list;
    }
    /**
     * 查询车辆行为类型
     * @param qualityDetailParamVo
     * @return
     */
    @Transactional
    public Pagination searchByBhvTypePage(QualityDetailParamVo qualityDetailParamVo){
    	Pagination page = this.myBatisPage("qualityAnlsDetail.getByBhvTypeCnt","qualityAnlsDetail.getByBhvTypeList", qualityDetailParamVo, TBsStatDayBhvEntity.class);
        return page;
    }

    /**
     * 查询车辆故障明细
     * @param qualityDetailParamVo
     * @return
     */
    @Transactional
    public Pagination searchByMtfTypePage(QualityDetailParamVo qualityDetailParamVo){
    	Pagination page = this.myBatisPage("qualityAnlsDetail.searchByMftCnt","qualityAnlsDetail.searchByMftList", qualityDetailParamVo, TBsStatDayMftEntity.class);
        return page;
    }

    /**
     * 分页查询报站明细
     * @param qualityDetailParamVo
     * @return
     */
    @Transactional
    @LeftOrgAnnotation()
    public Pagination searchTBsStatDayStnPage(QualityDetailParamVo qualityDetailParamVo){
        Pagination page = this.myBatisPage("qualityAnlsDetail.getTBsStatDayStnCnt","qualityAnlsDetail.getTBsStatDayStnList", qualityDetailParamVo, TBsStatDayStnEntity.class);
        return page;
    }

    @Transactional
    @LeftOrgAnnotation()
    public List<TBsStatDayStnEntity> searchTBsStatDayStnList(QualityDetailParamVo qualityDetailParamVo) throws Exception {
        List<TBsStatDayStnEntity> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("qualityAnlsDetail.getTBsStatDayStnList",qualityDetailParamVo), TBsStatDayStnEntity.class);
        if(PubUtil.isEmpty(list)){
            throw new BusinessException(MsgType.WARN.getFlag(), "没有数据导出！");
        }
        return list;
    }

    
}
